package projectdemo01.user;

import projectdemo01.book.BookList;
import projectdemo01.operation.IOperation;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:咭咭熊
 * Date:2021 - 09 - 23
 * Time:19:29
 */
public abstract class User {
    public String name;

    public IOperation[] operations;

    public User(String name){
        this.name = name;
    }

    //1.菜单页
    public abstract int menu();//抽象方法：没有集体的实现，交给子类进行实现

    //2.根据choice调用对应的操作
    public void doOperation(int choice, BookList bookList){
        //根据传递用户的引用不同，operations中存储的操作不同
        this.operations[choice].work(bookList);//根据choice 去数组当中查询对应的操作
    }
}
